<div class="divmain">
<table width="100%" id="frmaccountag_tblinfo" class="tblInfo">
<tr>
<td valign="top" class="width25"  >
<div >
<table class="info" id="frmaccountag_info">
<tr>
<td>
<div id="frmaccountag_divleft" class="divleft">
<table class="width100" >

       <tr id="frmaccountag_traccountype" style="display:none">
         <td align="right" width="43%" ><b>Loại tài khoản</b></td>
         <td id="frmaccountag_tdaccountype">
         <select id="frmaccountag_cbbaccountype" class="width100"><option value="">--Chọn--</option> </select> </td>
       </tr>
       <tr id="frmaccountag_tragent" style="display:none">
         <td align="right" width="43%" ><b>Tài khoản</b></td>
         <td id="frmaccountag_tdagent"> <select id="frmaccountag_cbbagent" class="width100"><option value="">--Tất cả--</option> </select> </td>
       </tr>
       
       <tr >
         <td align="right" width="43%" ><b>Tên đăng nhập</b></td>
         <td id="frmaccountag_tdaccount">
         <input type="text"   id="frmaccountag_txtUsername" value="" style="width:180px"/>
         </td>
       </tr>

      <tr>
         <td align="right"  ><b>Số điện thoại</b></td>
         <td >
             <input type="text" class="isNumber" id="frmaccountag_txtPhone" value="" style="width:180px"/>
         </td>
       </tr> 
</table>
    <div class="divactionbuton">

        <input type="hidden" id='frmaccountag_hdEdit' value="0"/>
<input type="hidden" id='frmaccountag_hdId' value=""/>
<button class="search btnsearch" id="frmaccountag_submit" onclick="frmaccountag_createReport()" style="float:right" type="button"> Xem </button> 
        </div>
</div>
</td>
</tr>
       
       <tr>
<td>

</td>
</tr>
</table>
</div>
</td>

<td class="clsmiddle"></td>
<td height="400" valign="top">
<div class="divGrid" id="frmaccountag_divGrid">
</div></td>
<td class="clsend"></td>

</tr>
</table>
</div>
<script language="javascript" src="script/js.const.js" >
</script>
   
<script language="javascript">
$(document).ready(function () {
    initForm('frmaccountag_tblinfo');
    initDivleft();
});

function frmaccountag_alertSelect(){
    alert('Vui lòng chọn tài khoản để cập nhật!');
}
function changePass(obj,id){
    var td = $(obj).parent();
    var txt =  "<input type='password' id='frmaccountag_txtPass"+id+"' style='width:90px'><img src='adagps.com/images/menu/save.png' style='cursor: pointer;float:right;' onclick='changeConfirm(this,"+id+")' /> <img src='adagps.com/images/menu/undo.png' style='cursor: pointer;float:right;' onclick='undoChange(this,"+id+")' /> ";
    $(td).html(txt); 
    
}
function changeConfirm(obj,id){
    var td = $(obj).parent();
    var newpass = $.trim($('#frmaccountag_txtPass'+id).val());
    if(newpass.length<6){
        alert('Vui lòng nhập mật khẩu hơn 5 kí tự');
        return false;
        }
    changeWaiting(0);
    xajax_commom_changePass(newpass,id);
    var imgChange = '<img src="adagps.com/images/menu/changepass.png" title="Đổi mật khẩu" style="cursor: pointer;" class="changePass" onclick="changePass(this,'+id+')" />';
    $(td).html(imgChange);
}

function undoChange(obj,id){
    var td = $(obj).parent();
    var imgChange = '<img src="adagps.com/images/menu/changepass.png" title="Đổi mật khẩu" style="cursor: pointer;" class="changePass" onclick="changePass(this,'+id+')" />';
    $(td).html(imgChange);  
}

function frmaccountag_changecbbagent(val){
    if(val==5){
        $('#frmaccountag_tragent').show();
    }else{
       $('#frmaccountag_tragent').hide(); 
    }
}

function frmaccountag_createReport(){
    var params = new Array();
    params['power_type_id']=$('#frmaccountag_cbbaccountype').val();
    params['user_name']=$.trim($('#frmaccountag_txtUsername').val());
    params['phone']=$.trim($('#frmaccountag_txtPhone').val());
    xajax_frmaccountag_loadGrid(params);

    
}                                    

changeWaiting(0);
xajax_frmaccountag_init();                          
</script>